const mongoose = require("mongoose");
const AdminModel = require("./AdminModel");
const ArticleModel = require('./ArticleModel')
const LikeSchema = mongoose.Schema({
   // u_id:String,
   // like_id: String,//文章id
   u_id: {//点赞用户的id
      type: mongoose.Schema.Types.ObjectId,
      ref: AdminModel
   },
   like_id: {//文章id
      type: mongoose.Schema.Types.ObjectId,
      ref: ArticleModel
   },
   datetime: { //记录时间
      type: Number, //存储一个数字时间戳 默认是当前时间
      default: Date.now()
   }
});
const LikeModel = mongoose.model("like", LikeSchema);
module.exports = LikeModel;